package cn.edu.cug.cs.gtl.apis.render.basics;

import cn.edu.cug.cs.gtl.apis.render.NativeObjectWrapper;

public interface Plane extends NativeObjectWrapper {

    /**
     *
     Returns the distance from a point to plane.
     * @param point
     * @return
     */
    float	getDistance(Vec3f point);

    /**
     *
     * Returns distance from origin to plane.
     * @return
     */
    float	getDistanceFromOrigin();

    /**
     * Returns normal vector to plane.
     * @return
     */
    Vec3f	getNormal();

    float[]	getValue();

    /**
     * Intersect line and plane, returning true if there is an intersection, false if line is parallel to plane.
     * @param l
     * @return
     */
    Vec3f	intersect(Line l);

    /**
     * Returns true if the given point is within the half-space defined by the plane.
     * @param point
     * @return
     */
    boolean	isInHalfSpace(Vec3f point);

    /**
     * Offset a plane by a given distance.
     * @param d
     */
    void	offset(float d);

    Plane	setValue(float[] components);
    Plane	setValue(float[] components, int startIndex);
    void	setValue(Plane copyFrom);

    /**
     * Transforms the plane by the given matrix.
     * @param matrix
     */
    void	transform(Matrix matrix);

    void reset(Vec3f p0, Vec3f p1, Vec3f p2);
    void reset(Vec3f normal, Vec3f point);
    void reset(Vec3f normal, float distance);


}
